﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Rio.Framework.Pages.AppCode.Models
{
    public class ObservableKeyValuePair<TKey, TValue> : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private TKey _key;
        private TValue _value;

        public TKey Key
        {
            get { return _key; }
            set
            {
                _key = value;
                OnPropertyCHanged("Value");
            }
        }

        public TValue Value
        {
            get { return _value; }
            set
            {
                _value = value;
                OnPropertyCHanged("Value");
            }
        }

        public ObservableKeyValuePair(TKey key, TValue value)
        {
            this.Key = key;
            this.Value = value;
        }

        /// <summary>
        /// Called when [property C hanged].
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        public void OnPropertyCHanged(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
